/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pokemon.dao;

import com.pokemon.entities.Stadium;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

/**
 *
 * @author Martin Fabian
 */
public interface StadiumDAO {
    /**
     * Adds stadium into database
     * 
     * @param stadium Stadium which will be stored in database
     */
    void addStadium(Stadium stadium);
    
    /**
     * Extract stadium from database according its id
     * 
     * @param id is id of stadion which we want get from database
     * @return   stadium acoording id, null while id can not be found
     */
    Stadium getStadium(Long id);
    
    /**
     * Updates stadium in database.
     * 
     * @param stadium which should be updated in database
     */
    void updateStadium(Stadium stadium);
    
    /**
     * Removes stadium from database.
     * 
     * @param stadium which should be removed
     */
    void removeStadium(Stadium stadium);
    
    /**
     * Method finds all stadiums in database and returns them
     * If there are no stadiums in database, method returns empty list.
     * 
     * @return list of all stadiums in database
     */
    List<Stadium> getAllStadiums();
    
    /**
     * Method sets entity manager factory.
     * 
     * @param entityManagerFactory
     */
    void setEntityManagerFactory(EntityManagerFactory entityManagerFactory);
    
    void setEm(EntityManager entityManager);
}
